# 发送消息
# 在8-9的程序中，编写一个名为send_messages()的函数，将每条消息都打印出来并移到一个名为sent_messages 的列表中。调用函数send_messages() ，再将两个列表都打印出来，确认正确地移动了消息

def show_messages(messages):
    for message in messages:
        print(message)


def send_messages(messages, sent_messages):
    while messages:
        sent_messages.append(messages.pop())


messages = ["gaoshi", "想回去"]
sent_messages = []
send_messages(messages, sent_messages)

print("\nmessages:")
show_messages(messages)

print("\nsent_messages:")
show_messages(sent_messages)
